package com.example.myhuangye.DS;

import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.myhuangye.R;

public class MainDS0ctivity extends AppCompatActivity implements View.OnClickListener{
    private Button DS6,DS7,DS8,DS9;
    private ImageButton DScall6,DScall7,DScall8,DScall9;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_ds0ctivity);
        DS6= (Button) findViewById(R.id.DS6);
        DS6.setOnClickListener(this);
        DScall6= (ImageButton) findViewById(R.id.DScall6);
        DScall6.setOnClickListener(this);

        DS7= (Button) findViewById(R.id.DS7);
        DS7.setOnClickListener(this);
        DScall7= (ImageButton) findViewById(R.id.DScall7);
        DScall7.setOnClickListener(this);

        DS8= (Button) findViewById(R.id.DS8);
        DS8.setOnClickListener(this);
        DScall8= (ImageButton) findViewById(R.id.DScall8);
        DScall8.setOnClickListener(this);

        DS9= (Button) findViewById(R.id.DS9);
        DS9.setOnClickListener(this);
        DScall9= (ImageButton) findViewById(R.id.DScall9);
        DScall9.setOnClickListener(this);
        findViewById(R.id.HT40).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }//回退//

    public void onClick(View view) {//点击事件//
        switch (view.getId()){
            case R.id.DS6:
                Uri uri = Uri.parse("http://www.suning.com");
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);

                break;
            case R.id.DScall6:
                Intent intent1=  new Intent(Intent.ACTION_DIAL);
                intent1.setData(Uri.parse("tel:025-66996699"));
                startActivity(intent1);
                break;

            case R.id.DS7:
                Uri uri1 = Uri.parse("http://www.gome.com.cn");
                Intent intent2 = new Intent(Intent.ACTION_VIEW, uri1);
                startActivity(intent2);

                break;
            case R.id.DScall7:
                Intent intent3=  new Intent(Intent.ACTION_DIAL);
                intent3.setData(Uri.parse("tel:4008708708"));
                startActivity(intent3);
                break;

            case R.id.DS8:
                Uri uri2 = Uri.parse("http://www.shangpin.com");
                Intent intent4 = new Intent(Intent.ACTION_VIEW, uri2);
                startActivity(intent4);

                break;
            case R.id.DScall8:
                Intent intent5=  new Intent(Intent.ACTION_DIAL);
                intent5.setData(Uri.parse("tel:4006-900-900"));
                startActivity(intent5);
                break;

            case R.id.DS9:
                Uri uri3 = Uri.parse("http://www.m.yhd.com");
                Intent intent6 = new Intent(Intent.ACTION_VIEW, uri3);
                startActivity(intent6);

                break;
            case R.id.DScall9:
                Intent intent7=  new Intent(Intent.ACTION_DIAL);
                intent7.setData(Uri.parse("tel:4000071111"));
                startActivity(intent7);
                break;


        }


    }



}


